]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shellDBus: Add ListExtensions() and GetExtensionInfo()
authorJasper St. Pierre <jstpierre@mecheye.net>
Thu, 23 Jun 2011 02:03:04 +0000 (22:03 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Thu, 4 Aug 2011 17:40:04 +0000 (13:40 -0400)
GetExtensionInfo() takes a UUID and returns a JSON object with information
about that extension including their metadata, path and current state.

ListExtensions() takes no arguments and returns a JSON object mapping UUIDs
to the same information objects described above.

https://bugzilla.gnome.org/show_bug.cgi?id=654770

js/ui/shellDBus.js

index c67028740d8eb093659352a288e48718b3d3751e..ee41491c7b85b0cd1aa7dbd51d3a0f078e68d99a 100644 (file)
@@ -2,6 +2,7 @@
 
 const DBus = imports.dbus;
 
+const ExtensionSystem = imports.ui.extensionSystem;
 const Main = imports.ui.main;
 
 const GnomeShellIface = {
@@ -9,7 +10,15 @@ const GnomeShellIface = {
     methods: [{ name: 'Eval',
                 inSignature: 's',
                 outSignature: 'bs'
-              }
+              },
+              { name: 'ListExtensions',
+                inSignature: '',
+                outSignature: 'a{sa{sv}}'
+              },
+              { name: 'GetExtensionInfo',
+                inSignature: 's',
+                outSignature: 'a{sv}'
+              },
              ],
     signals: [],
     properties: [{ name: 'OverviewActive',
@@ -56,6 +65,14 @@ GnomeShell.prototype = {
         return [success, returnValue];
     },
 
+    ListExtensions: function() {
+        return ExtensionSystem.extensionMeta;
+    },
+
+    GetExtensionInfo: function(uuid) {
+        return ExtensionSystem.extensionMeta[uuid] || {};
+    },
+
     get OverviewActive() {
         return Main.overview.visible;
     },